﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;

namespace ERPTemplate.Template.MultiTable
{
    public partial class MultiTableMainList : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                RuleCode.Table.User u = new RuleCode.Table.User();
                RuleQueryTable1.SetQueryTable(u, this.Page.Title);
                RuleQueryTable1.PageSize = 20;
                WebPager1.PageSize = RuleQueryTable1.PageSize;
                //RuleQueryTable1.FixedRange = "1=2";
                bind(0);
            }
        }
        private void bind(Int32 _pageindex)
        {

            RuleQueryTable1.run(_pageindex);
            WebPager1.DT = RuleQueryTable1.DT;
            WebPager1.DataBind();

        }

        protected void RuleQueryTable1_ButtonClick(object sender, EventArgs e)
        {
            bind(0);
        }

        protected void WebPager1_PageIndexChanged(object sender, RuleCode.Controls.PageChangedEventArgs e)
        {
            WebPager1.CurrentPageIndex = e.NewPageIndex;
            bind(e.NewPageIndex);
        }
    }
}
